package top.frsf.envi;

import top.frsf.GameObject;

import java.awt.*;

/**
 * @BelongsProject: MiniPZ
 * @BelongsPackage: top.frsf.envi
 * @Author: FRSF
 * @CreateTime: 2022-09-06  17:38
 * @Description: 铲子
 * @Version: 1.0
 */
public class Shovel extends GameObject {

    private Point point = new Point(645, 35);


    public Shovel(String img, int x, int y, int width, int height) {
        super(img, x, y, width, height);
    }

    public void setPoint(Point point) {
        this.point.x = point.x - getWidth() / 2;
        this.point.y = point.y - getHeight() / 2;
    }

    public void move() {
        setX(point.x);
        setY(point.y);
    }

    @Override
    public void paintSelf(Graphics g) {
        super.paintSelf(g);
        move();
    }

}
